import 'package:flutter/material.dart';

class TransparentRouteBuilder<T> extends PageRouteBuilder<T> {
  TransparentRouteBuilder({
    RouteSettings? settings,
    required RoutePageBuilder pageBuilder,
    opaque: false,
    Color? barrierColor,
    RouteTransitionsBuilder? transitionsBuilder,
    barrierDismissible = false,
    transitionDuration = const Duration(milliseconds: 300),
    reverseTransitionDuration = const Duration(milliseconds: 300),
    barrierLabel,
    maintainState = true,
    bool fullscreenDialog = false,
  }) : super(
          maintainState: maintainState,
          settings: settings,
          pageBuilder: pageBuilder,
          barrierColor: barrierColor ?? Colors.black.withOpacity(0.4),
          opaque: opaque,
          barrierDismissible: barrierDismissible,
          transitionDuration: transitionDuration,
          reverseTransitionDuration: reverseTransitionDuration,
          barrierLabel: barrierLabel,
          fullscreenDialog: fullscreenDialog,
          transitionsBuilder: transitionsBuilder ??
              (BuildContext context, Animation<double> animation,
                  Animation<double> secondaryAnimation, Widget child) {
                return child;
              },
        );

// @override
// Widget buildPage(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation) {
//   return pageBuilder(context, animation, secondaryAnimation);
// }
//
// @override
// Widget buildTransitions(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
//   return transitionsBuilder(context, animation, secondaryAnimation, child);
// }
}
